package pers.lmd.controller;

import cn.dev33.satoken.annotation.SaCheckRole;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.lmd.domain.R;
import pers.lmd.common.constant.ResultEnum;
import pers.lmd.domain.vo.StudentVO;
import pers.lmd.service.IStudentService;
import pers.lmd.domain.vo.StudentStatusVO;
import pers.lmd.common.utils.ResultUtil;

/**
 * @Author lmd
 * @Date 2023/4/11 21:59
 */
@RequiredArgsConstructor
@RestController
@Tag(name = "学生控制器")
@RequestMapping("/system")
public class StudentController {
    private final IStudentService IStudentService;

    @Operation(summary = "学生信息")
    @GetMapping("/info")
    public R<StudentVO> getInfo() {
        return ResultUtil.success(ResultEnum.SUCCESS, IStudentService.getInfo());
    }

    @SaCheckRole("学生")
    @Operation(summary = "学生健康状态")
    @GetMapping("/status")
    public R<StudentStatusVO> getStudentStatus(){
        return ResultUtil.success(ResultEnum.SUCCESS, IStudentService.getStatus());
    }
}
